<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddUnionShopIdxToShopMointorDataTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        try {
            Schema::connection('mysqlDataStatistics')->table('shop_monitor_data', function (Blueprint $table) {
                $table->dropIndex('shopId');
            });
        } catch (\Exception $e) {

        }


        Schema::connection('mysqlDataStatistics')->table('shop_monitor_data', function (Blueprint $table) {
            $table->index(['shopId', 'type', 'dataAt'], 'idx_shopTypeAt');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {

    }
}
